Integrand size = 19, antiderivative size = 41 \[ \int \cot ^2(c+d x) (a+b \sin (c+d x)) \, dx=-a x-\frac {b \text {arctanh}(\cos (c+d x))}{d}+\frac {b \cos (c+d x)}{d}-\frac {a \cot (c+d x)}{d} \]
[Out]
Time = 0.04 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {2801, 2672, 327, 212, 3554, 8} \[ \int \cot ^2(c+d x) (a+b \sin (c+d x)) \, dx=-\frac {a \cot (c+d x)}{d}-a x-\frac {b \text {arctanh}(\cos (c+d x))}{d}+\frac {b \cos (c+d x)}{d} \]
[In]
[Out]
Rule 8
Rule 212
Rule 327
Rule 2672
Rule 2801
Rule 3554
Rubi steps \begin{align*} \text {integral}& = \int \left (b \cos (c+d x) \cot (c+d x)+a \cot ^2(c+d x)\right ) \, dx \\ & = a \int \cot ^2(c+d x) \, dx+b \int \cos (c+d x) \cot (c+d x) \, dx \\ & = -\frac {a \cot (c+d x)}{d}-a \int 1 \, dx-\frac {b \text {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d} \\ & = -a x+\frac {b \cos (c+d x)}{d}-\frac {a \cot (c+d x)}{d}-\frac {b \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d} \\ & = -a x-\frac {b \text {arctanh}(\cos (c+d x))}{d}+\frac {b \cos (c+d x)}{d}-\frac {a \cot (c+d x)}{d} \\ \end{align*}
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 0.01 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.83 \[ \int \cot ^2(c+d x) (a+b \sin (c+d x)) \, dx=\frac {b \cos (c+d x)}{d}-\frac {a \cot (c+d x) \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},-\tan ^2(c+d x)\right )}{d}-\frac {b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d} \]
[In]
[Out]
Time = 0.28 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.20
method | result | size |
derivativedivides | \(\frac {a \left (-\cot \left (d x +c \right )-d x -c \right )+b \left (\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )}{d}\) | \(49\) |
default | \(\frac {a \left (-\cot \left (d x +c \right )-d x -c \right )+b \left (\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )}{d}\) | \(49\) |
parallelrisch | \(\frac {-2 a x d -2 b +2 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a \sec \left (\frac {d x}{2}+\frac {c}{2}\right ) \csc \left (\frac {d x}{2}+\frac {c}{2}\right )-2 a \cot \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b \cos \left (d x +c \right )}{2 d}\) | \(69\) |
risch | \(-a x +\frac {b \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {b \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}-\frac {2 i a}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}\) | \(91\) |
norman | \(\frac {-\frac {a}{2 d}+\frac {a \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-a x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a x \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {2 b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+\frac {b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) | \(113\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 84 vs. \(2 (41) = 82\).
Time = 0.28 (sec) , antiderivative size = 84, normalized size of antiderivative = 2.05 \[ \int \cot ^2(c+d x) (a+b \sin (c+d x)) \, dx=-\frac {b \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - b \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 2 \, a \cos \left (d x + c\right ) + 2 \, {\left (a d x - b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{2 \, d \sin \left (d x + c\right )} \]
[In]
[Out]
\[ \int \cot ^2(c+d x) (a+b \sin (c+d x)) \, dx=\int \left (a + b \sin {\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )} \csc ^{2}{\left (c + d x \right )}\, dx \]
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.32 \[ \int \cot ^2(c+d x) (a+b \sin (c+d x)) \, dx=-\frac {2 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} a - b {\left (2 \, \cos \left (d x + c\right ) - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{2 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 108 vs. \(2 (41) = 82\).
Time = 0.31 (sec) , antiderivative size = 108, normalized size of antiderivative = 2.63 \[ \int \cot ^2(c+d x) (a+b \sin (c+d x)) \, dx=-\frac {6 \, {\left (d x + c\right )} a - 6 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - 3 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 10 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}}{6 \, d} \]
[In]
[Out]
Time = 10.06 (sec) , antiderivative size = 158, normalized size of antiderivative = 3.85 \[ \int \cot ^2(c+d x) (a+b \sin (c+d x)) \, dx=\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}+\frac {b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-4\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a}{d\,\left (2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}+\frac {2\,a\,\mathrm {atan}\left (\frac {4\,a^2}{4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+4\,b\,a}-\frac {4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+4\,b\,a}\right )}{d} \]
[In]
[Out]